package com.fhz.a2102shopjava.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.fhz.a2102shopjava.ui.login.data.model.LoggedInUser;

import java.util.List;

/**
 * 时间:2023/8/18
 *
 * @author Mr.Feng
 * 简述:
 */
@Dao
public interface UserDao {
    @Insert
    void insertAll(LoggedInUser... users);

    @Update
    void updateUser(LoggedInUser user);

    @Delete
    void delete(LoggedInUser user);

    @Query("SELECT * FROM c_user")
    List<LoggedInUser> getAll();


    @Query("SELECT * FROM c_user where nickname = :nickname")
    LoggedInUser getUserByName(String nickname);


}
